package la.iok.hzsvn.lewin.movie.core.shopmovie.vo;

import la.iok.hzsvn.share.collection.IdAble;

import java.util.Date;
import java.util.Objects;

public class PlayerFeeBase implements IdAble<Long> {
    /**
     * VIP用户使用账户余额支付
     */
    public static final Integer PAY_TYPE_VIP = 1;
    /**
     * 美团支付
     */
    public static final Integer PAY_TYPE_MT = 2;
    /**
     * 微信支付
     */
    public static final Integer PAY_TYPE_WX = 3;
    /**
     * 支付宝支付
     */
    public static final Integer PAY_TYPE_ALI = 4;
    /**
     * 已支付状态
     */
    public static final Integer STATUS_PAID = 1;
    /**
     * 未支付状态
     */
    public static final Integer STATUS_UNPAID = 0;
    /**
     * 剧本费
     */
    public static final Integer FEE_TYPE_MOVIE = 1;
    /**
     * 附加费
     */
    public static final Integer FEE_TYPE_ADDITION = 2;
    private Long id;
    /**
     * 玩家id
     */
    private Long playerId;
    /**
     * 收费类型。1：剧本费，2：附加费，如修仙费
     * 剧本费不可以取消，附加费可以取消
     */
    private Integer feeType;
    /**
     * 收费名称
     */
    private String feeName;
    /**
     * 收费金额，单位分
     */
    private Integer feeAmount;
    /**
     * 优惠券抵扣金额。有两个作用,1:记录抵扣的金额；2:用于判断是否已经有优惠券抵扣过。默认为0，此时没有优惠券抵扣，非0就是已经有抵扣，目前会判断不能重复抵扣
     */
    private Integer couponDeductionAmount;
    /**
     * 状态。0：未支付，1：已支付
     */
    private Integer status;
    /**
     * 支付方式。1：会员支付；2：美团支付；3：微信支付；4：支付宝支付。未支付时为0
     */
    private Integer payType;
    /**
     * 支付确认时间
     */
    private Date payConfirmTime;
    /**
     * 数据版本
     */
    private Long version;

    @Override
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getPlayerId() {
        return playerId;
    }

    public void setPlayerId(Long playerId) {
        this.playerId = playerId;
    }

    public Integer getFeeType() {
        return feeType;
    }

    public void setFeeType(Integer feeType) {
        this.feeType = feeType;
    }

    public String getFeeName() {
        return feeName;
    }

    public void setFeeName(String feeName) {
        this.feeName = feeName;
    }

    public Integer getFeeAmount() {
        return feeAmount;
    }

    public void setFeeAmount(Integer feeAmount) {
        this.feeAmount = feeAmount;
    }

    public Integer getCouponDeductionAmount() {
        return couponDeductionAmount;
    }

    public void setCouponDeductionAmount(Integer couponDeductionAmount) {
        this.couponDeductionAmount = couponDeductionAmount;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getPayType() {
        return payType;
    }

    public void setPayType(Integer payType) {
        this.payType = payType;
    }

    public Date getPayConfirmTime() {
        return payConfirmTime;
    }

    public void setPayConfirmTime(Date payConfirmTime) {
        this.payConfirmTime = payConfirmTime;
    }

    public Long getVersion() {
        return version;
    }

    public void setVersion(Long version) {
        this.version = version;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof PlayerFeeBase)) return false;
        PlayerFeeBase that = (PlayerFeeBase) o;
        return Objects.equals(id, that.id) && Objects.equals(playerId, that.playerId)
                && Objects.equals(feeType, that.feeType) && Objects.equals(feeName, that.feeName)
                && Objects.equals(feeAmount, that.feeAmount)
                && Objects.equals(couponDeductionAmount, that.couponDeductionAmount)
                && Objects.equals(status, that.status) && Objects.equals(payType, that.payType)
                && Objects.equals(payConfirmTime, that.payConfirmTime) && Objects.equals(version, that.version);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, playerId, feeType, feeName, feeAmount, couponDeductionAmount, status, payType, payConfirmTime, version);
    }

    /**
     * 费用项是否已经支付
     * @return 已经支付返回true,否则false
     */
    public boolean paid(){
        return STATUS_PAID.equals(status);
    }
}
